package cn.smbms.dao;

import java.sql.Connection;
import java.util.List;

import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import cn.smbms.pojo.Provider;

@Repository("providerMapper")
public interface ProviderMapper {

	/**
	 * 增加供应商
	 * 
	 * @param connection
	 * @param provider
	 * @return
	 * @throws Exception
	 */
	public int add(Provider provider) throws Exception;

	/**
	 * 通过供应商名称、编码获取供应商列表-模糊查询-providerList
	 * 
	 * @param connection
	 * @param proName
	 * @return
	 * @throws Exception
	 */
	public List<Provider> getProviderList(@Param("proName") String proName, @Param("proCode") String proCode,
			@Param("from") Integer currentPageNo, @Param("pageSize") Integer pageSize) throws Exception;

	/**
	 * 根据条件查询用户表记录数
	 * 
	 * @param queryUserName
	 * @param queryUserRole
	 * @return
	 */
	public int getProviderCount(@Param("proName") String proName, @Param("proCode") String proCode);

	/**
	 * 通过proId删除Provider
	 * 
	 * @param delId
	 * @return
	 * @throws Exception
	 */
	public int deleteProviderById(@Param("id") String delId) throws Exception;
 

	/**
	 * 通过proId获取Provider
	 * 
	 * @param connection
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public List<Provider> getProviderById() throws Exception;

	/**
	 * 修改用户信息
	 * 
	 * @param connection
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public int modify(Provider provider) throws Exception;

}
